<#import "/spring.ftl" as s>
<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <title>任务开关配置 - 员工管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <#include '../include/baselink.ftl'>
    <link rel="stylesheet" type="text/css" href="<@s.url '/assets/css/jquery.pagination.css'/>">
    <style>
        .item a {
            text-decoration: none;
        }

        .item a:hover {
            text-decoration: none;
        }
    </style>
</head>

<body class="dashboard-page">
<#include '../include/skin-toolbox.ftl'>
<!-- Start: Main -->
<div id="main">
    <#include '../include/header.ftl'>
    <#include '../include/sidebar.ftl'>
    <!-- Start: Content-Wrapper -->
    <section id="content_wrapper">
        <!-- Begin: Content -->
        <section id="content" class="table-layout animated fadeIn">

            <!-- begin: .tray-center -->
            <div class="tray tray-center">
                <div class="panel" id="spy7">
                    <div class="panel-heading">
                        <span class="panel-icon"><i class="fa fa-table"></i></span>
                        <span class="panel-title">工具</span>
                        <span class="panel-controls">
                            <a href="#" class="panel-control-color"></a>
                            <a href="#" class="panel-control-collapse"></a>
                            <a href="#" class="panel-control-fullscreen"></a>
                        </span>
                    </div>

                    <div class="panel-body pn">
                        <div class="panel">
                            <div class="panel-heading">
                                <span class="panel-icon"><i class="fa fa-table"></i></span>
                                <span class="panel-title">初始化服务</span>
                                <span class="panel-controls">
                            <a href="#" class="panel-control-color"></a>
                            <a href="#" class="panel-control-collapse"></a>
                            <a href="#" class="panel-control-fullscreen"></a>
                        </span>
                            </div>
                            <div class="panel-body">
                                <div class="panel-body">
                                    <table class="table table-bordered table-hover table-condensed">
                                        <thead>
                                        <tr>
                                            <th>操作</th>
                                            <th>按钮</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td class="col-md-3">
                                                <input type="text" v-model="id" class="form-control">
                                            </td>
                                            <td class="col-md-9">
                                                <button type="button" class="btn btn-system btn-sm" @click="sync">
                                                    同步单个订单
                                                </button>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </section>

        <#include '../include/footer.ftl' />
    </section>
</div>
<#include '../include/footer_js.ftl'/>

<script>
    var app = new Vue({
        el: '#main',
        data: {
            id: ""
        },
        created: function () {
        },
        watch: {},
        methods: {
            sync: function () {
                var url = contentPath + "/api/view/tools/synchronize/" + this.id;
                console.log(url)
                this.$http.get(url).then(
                    function (response) {
                        toastr.success("同步成功");
                    }, function (error) {
                        toastr.error("设置失败," + error.body.msg, "设置结果");
                    }
                )
            }
        }
    });

</script>
</body>
</html>